﻿using Atlanchim.Crm.Mui.Commands;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace Atlanchim.Crm.Mui.Content
{
    public class AdminPageModel : INotifyPropertyChanged
    {
        private string _commandText;
        public string CommandText
        {
            get
            {
                return _commandText;
            }
            set
            {
                _commandText = value;
                OnPropertyChanged("CommandText");
            }
        }


        private AdminCommand _adminCommand;
        public AdminCommand AdminCommand
        {
            get
            {
                return _adminCommand;
            }
            set
            {
                _adminCommand = value;
                OnPropertyChanged("AdminCommand");
            }
        }

        private NewDbCommand _newDbCommand;
        public NewDbCommand NewDbCommand
        {
            get
            {
                return _newDbCommand;
            }
            set
            {
                _newDbCommand = value;
                OnPropertyChanged("NewDbCommand");
            }
        }

        private SelectCreateDbCommand _selectCreateDbCommand;
        public SelectCreateDbCommand SelectCreateDbCommand
        {
            get
            {
                return _selectCreateDbCommand;
            }
            set
            {
                _selectCreateDbCommand = value;
                OnPropertyChanged("SelectCreateDbCommand");
            }
        }

        private BackupCommand _backupCommand;
        public BackupCommand BackupCommand
        {
            get
            {
                return _backupCommand;
            }
            set
            {
                _backupCommand = value;
                OnPropertyChanged("BackupCommand");
            }
        }

        public AdminPageModel()
        {
            AdminCommand = new AdminCommand();
            NewDbCommand = new NewDbCommand();
            SelectCreateDbCommand = new SelectCreateDbCommand();
            BackupCommand = new BackupCommand();
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
